export interface UserProfile {
  id: string
  username: string
  avatar?: string
  rating: number
  title?: string
  country?: string
  joinDate: Date
  lastActive: Date
  status: 'online' | 'offline' | 'playing' | 'away'
}

export interface FriendRequest {
  id: string
  from: UserProfile
  to: UserProfile
  message?: string
  status: 'pending' | 'accepted' | 'rejected'
  createdAt: Date
}

export interface ChatMessage {
  id: string
  from: UserProfile
  to: UserProfile | null // null 表示全局聊天
  content: string
  type: 'text' | 'move' | 'emoji' | 'system'
  timestamp: Date
}

export interface Challenge {
  id: string
  from: UserProfile
  to: UserProfile
  timeControl: {
    initial: number
    increment: number
  }
  color?: 'white' | 'black' | 'random'
  rated: boolean
  message?: string
  status: 'pending' | 'accepted' | 'rejected' | 'expired'
  createdAt: Date
  expiresAt: Date
}

export interface Achievement {
  id: string
  name: string
  description: string
  icon: string
  progress: number
  maxProgress: number
  completed: boolean
  completedAt?: Date
  reward?: {
    type: 'rating' | 'title' | 'badge'
    value: string | number
  }
} 